<!--
 * @Author: zxh
 * @Email: 1271027008@qq.com
 * @Date: 2020-03-26 08:57:21
 * @Descripttion: 
 -->
<div class="version_container">
    <div nz-row nzGutter="16">
        <button nz-button nzType="primary" (click)="addModal()">新增</button>
    </div>
    <div nz-row nzGutter="16" class="list_row">
        <nz-table #basicTable [nzData]="listOfData" [nzBordered]="true" [nzFrontPagination]="false" nzSize="small">
            <thead>
                <tr>
                    <th>版本号</th>
                    <th>创建人</th>
                    <th>创建时间</th>
                    <th>描述</th>
                </tr>
            </thead>
            <tbody>
                <tr *ngFor="let data of basicTable.data">
                    <td>{{ data.code }}</td>
                    <td>{{ data.createByName }}</td>
                    <td>{{ data.createDate }}</td>
                    <td>{{ data.remarks }}</td>
                </tr>
            </tbody>
        </nz-table>
    </div>
    <div nz-row nzGutter="16" class="page_row">
        <nz-pagination (nzPageIndexChange)="clickPage($event)" [nzPageIndex]="pageIndex" [nzTotal]="totalSize"
            [nzPageSize]="pageSize" [nzShowTotal]="totalTemplate"></nz-pagination>
        <ng-template #totalTemplate let-total> 共 {{totalSize}} 条 </ng-template>
    </div>
</div>
<div id="modal_box_1"></div>
<nz-modal appDragModal nzMaskClosable="false" [nzGetContainer]="modalDomBoxA" [nzFooter]="null" nzMaskClosable="false"
    [(nzVisible)]="isVisible" nzTitle="新增" (nzOnCancel)="handleCancel()" class="modal_row">
    <form nz-form [formGroup]="validateForm" (ngSubmit)="submitForm()">
        <nz-form-item>
            <nz-form-label [nzSpan]="5" nzRequired>版本号</nz-form-label>
            <nz-form-control [nzSpan]="19" nzErrorTip="请输入版本号">
                <input formControlName="version" nz-input placeholder="请输入版本号" />
            </nz-form-control>
        </nz-form-item>
        <nz-form-item>
            <nz-form-label [nzSpan]="5" nzRequired>上传文件</nz-form-label>
            <nz-form-control [nzSpan]="19" nzErrorTip="请上传文件">
                <nz-upload [nzDisabled]='uploadList.length!==0' [nzAction]="uploadFileUrl" (nzChange)="upload($event)" [nzFileList]="uploadList">
                    <button nz-button type="button"><i nz-icon nzType="upload"></i>上传文件</button>
                </nz-upload>
            </nz-form-control>
        </nz-form-item>
        <nz-form-item>
            <nz-form-label [nzSpan]="5">是否强制更新</nz-form-label>
            <nz-form-control [nzSpan]="19">
                <nz-select class="select_term" formControlName="isMust" nzDropdownClassName="select_custom">
                    <nz-option nzValue="0" nzLabel="否"></nz-option>
                    <nz-option nzValue="1" nzLabel="是"></nz-option>
                </nz-select>
            </nz-form-control>
        </nz-form-item>
        <div nz-row class="button_row">
            <button nz-button nzType="default" (click)="handleCancel()">取消</button>
            <button nz-button nzType="primary">确定</button>
        </div>
    </form>
</nz-modal>